/*
 * XML Type:  InvestmentPositionList
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.InvestmentPositionList
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML InvestmentPositionList(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class InvestmentPositionListImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.InvestmentPositionList
{
    
    public InvestmentPositionListImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName POSMF$0 = 
        new javax.xml.namespace.QName("", "POSMF");
    private static final javax.xml.namespace.QName POSSTOCK$2 = 
        new javax.xml.namespace.QName("", "POSSTOCK");
    private static final javax.xml.namespace.QName POSDEBT$4 = 
        new javax.xml.namespace.QName("", "POSDEBT");
    private static final javax.xml.namespace.QName POSOPT$6 = 
        new javax.xml.namespace.QName("", "POSOPT");
    private static final javax.xml.namespace.QName POSOTHER$8 = 
        new javax.xml.namespace.QName("", "POSOTHER");
    
    
    /**
     * Gets array of all "POSMF" elements
     */
    public net.ofx.types.x2003.x04.PositionMutualFund[] getPOSMFArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(POSMF$0, targetList);
            net.ofx.types.x2003.x04.PositionMutualFund[] result = new net.ofx.types.x2003.x04.PositionMutualFund[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "POSMF" element
     */
    public net.ofx.types.x2003.x04.PositionMutualFund getPOSMFArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionMutualFund target = null;
            target = (net.ofx.types.x2003.x04.PositionMutualFund)get_store().find_element_user(POSMF$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "POSMF" element
     */
    public int sizeOfPOSMFArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(POSMF$0);
        }
    }
    
    /**
     * Sets array of all "POSMF" element
     */
    public void setPOSMFArray(net.ofx.types.x2003.x04.PositionMutualFund[] posmfArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(posmfArray, POSMF$0);
        }
    }
    
    /**
     * Sets ith "POSMF" element
     */
    public void setPOSMFArray(int i, net.ofx.types.x2003.x04.PositionMutualFund posmf)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionMutualFund target = null;
            target = (net.ofx.types.x2003.x04.PositionMutualFund)get_store().find_element_user(POSMF$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(posmf);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "POSMF" element
     */
    public net.ofx.types.x2003.x04.PositionMutualFund insertNewPOSMF(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionMutualFund target = null;
            target = (net.ofx.types.x2003.x04.PositionMutualFund)get_store().insert_element_user(POSMF$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "POSMF" element
     */
    public net.ofx.types.x2003.x04.PositionMutualFund addNewPOSMF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionMutualFund target = null;
            target = (net.ofx.types.x2003.x04.PositionMutualFund)get_store().add_element_user(POSMF$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "POSMF" element
     */
    public void removePOSMF(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(POSMF$0, i);
        }
    }
    
    /**
     * Gets array of all "POSSTOCK" elements
     */
    public net.ofx.types.x2003.x04.PositionStock[] getPOSSTOCKArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(POSSTOCK$2, targetList);
            net.ofx.types.x2003.x04.PositionStock[] result = new net.ofx.types.x2003.x04.PositionStock[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "POSSTOCK" element
     */
    public net.ofx.types.x2003.x04.PositionStock getPOSSTOCKArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionStock target = null;
            target = (net.ofx.types.x2003.x04.PositionStock)get_store().find_element_user(POSSTOCK$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "POSSTOCK" element
     */
    public int sizeOfPOSSTOCKArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(POSSTOCK$2);
        }
    }
    
    /**
     * Sets array of all "POSSTOCK" element
     */
    public void setPOSSTOCKArray(net.ofx.types.x2003.x04.PositionStock[] posstockArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(posstockArray, POSSTOCK$2);
        }
    }
    
    /**
     * Sets ith "POSSTOCK" element
     */
    public void setPOSSTOCKArray(int i, net.ofx.types.x2003.x04.PositionStock posstock)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionStock target = null;
            target = (net.ofx.types.x2003.x04.PositionStock)get_store().find_element_user(POSSTOCK$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(posstock);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "POSSTOCK" element
     */
    public net.ofx.types.x2003.x04.PositionStock insertNewPOSSTOCK(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionStock target = null;
            target = (net.ofx.types.x2003.x04.PositionStock)get_store().insert_element_user(POSSTOCK$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "POSSTOCK" element
     */
    public net.ofx.types.x2003.x04.PositionStock addNewPOSSTOCK()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionStock target = null;
            target = (net.ofx.types.x2003.x04.PositionStock)get_store().add_element_user(POSSTOCK$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "POSSTOCK" element
     */
    public void removePOSSTOCK(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(POSSTOCK$2, i);
        }
    }
    
    /**
     * Gets array of all "POSDEBT" elements
     */
    public net.ofx.types.x2003.x04.PositionDebt[] getPOSDEBTArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(POSDEBT$4, targetList);
            net.ofx.types.x2003.x04.PositionDebt[] result = new net.ofx.types.x2003.x04.PositionDebt[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "POSDEBT" element
     */
    public net.ofx.types.x2003.x04.PositionDebt getPOSDEBTArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionDebt target = null;
            target = (net.ofx.types.x2003.x04.PositionDebt)get_store().find_element_user(POSDEBT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "POSDEBT" element
     */
    public int sizeOfPOSDEBTArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(POSDEBT$4);
        }
    }
    
    /**
     * Sets array of all "POSDEBT" element
     */
    public void setPOSDEBTArray(net.ofx.types.x2003.x04.PositionDebt[] posdebtArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(posdebtArray, POSDEBT$4);
        }
    }
    
    /**
     * Sets ith "POSDEBT" element
     */
    public void setPOSDEBTArray(int i, net.ofx.types.x2003.x04.PositionDebt posdebt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionDebt target = null;
            target = (net.ofx.types.x2003.x04.PositionDebt)get_store().find_element_user(POSDEBT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(posdebt);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "POSDEBT" element
     */
    public net.ofx.types.x2003.x04.PositionDebt insertNewPOSDEBT(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionDebt target = null;
            target = (net.ofx.types.x2003.x04.PositionDebt)get_store().insert_element_user(POSDEBT$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "POSDEBT" element
     */
    public net.ofx.types.x2003.x04.PositionDebt addNewPOSDEBT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionDebt target = null;
            target = (net.ofx.types.x2003.x04.PositionDebt)get_store().add_element_user(POSDEBT$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "POSDEBT" element
     */
    public void removePOSDEBT(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(POSDEBT$4, i);
        }
    }
    
    /**
     * Gets array of all "POSOPT" elements
     */
    public net.ofx.types.x2003.x04.PositionOption[] getPOSOPTArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(POSOPT$6, targetList);
            net.ofx.types.x2003.x04.PositionOption[] result = new net.ofx.types.x2003.x04.PositionOption[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "POSOPT" element
     */
    public net.ofx.types.x2003.x04.PositionOption getPOSOPTArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionOption target = null;
            target = (net.ofx.types.x2003.x04.PositionOption)get_store().find_element_user(POSOPT$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "POSOPT" element
     */
    public int sizeOfPOSOPTArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(POSOPT$6);
        }
    }
    
    /**
     * Sets array of all "POSOPT" element
     */
    public void setPOSOPTArray(net.ofx.types.x2003.x04.PositionOption[] posoptArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(posoptArray, POSOPT$6);
        }
    }
    
    /**
     * Sets ith "POSOPT" element
     */
    public void setPOSOPTArray(int i, net.ofx.types.x2003.x04.PositionOption posopt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionOption target = null;
            target = (net.ofx.types.x2003.x04.PositionOption)get_store().find_element_user(POSOPT$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(posopt);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "POSOPT" element
     */
    public net.ofx.types.x2003.x04.PositionOption insertNewPOSOPT(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionOption target = null;
            target = (net.ofx.types.x2003.x04.PositionOption)get_store().insert_element_user(POSOPT$6, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "POSOPT" element
     */
    public net.ofx.types.x2003.x04.PositionOption addNewPOSOPT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionOption target = null;
            target = (net.ofx.types.x2003.x04.PositionOption)get_store().add_element_user(POSOPT$6);
            return target;
        }
    }
    
    /**
     * Removes the ith "POSOPT" element
     */
    public void removePOSOPT(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(POSOPT$6, i);
        }
    }
    
    /**
     * Gets array of all "POSOTHER" elements
     */
    public net.ofx.types.x2003.x04.PositionOther[] getPOSOTHERArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(POSOTHER$8, targetList);
            net.ofx.types.x2003.x04.PositionOther[] result = new net.ofx.types.x2003.x04.PositionOther[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "POSOTHER" element
     */
    public net.ofx.types.x2003.x04.PositionOther getPOSOTHERArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionOther target = null;
            target = (net.ofx.types.x2003.x04.PositionOther)get_store().find_element_user(POSOTHER$8, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "POSOTHER" element
     */
    public int sizeOfPOSOTHERArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(POSOTHER$8);
        }
    }
    
    /**
     * Sets array of all "POSOTHER" element
     */
    public void setPOSOTHERArray(net.ofx.types.x2003.x04.PositionOther[] posotherArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(posotherArray, POSOTHER$8);
        }
    }
    
    /**
     * Sets ith "POSOTHER" element
     */
    public void setPOSOTHERArray(int i, net.ofx.types.x2003.x04.PositionOther posother)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionOther target = null;
            target = (net.ofx.types.x2003.x04.PositionOther)get_store().find_element_user(POSOTHER$8, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(posother);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "POSOTHER" element
     */
    public net.ofx.types.x2003.x04.PositionOther insertNewPOSOTHER(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionOther target = null;
            target = (net.ofx.types.x2003.x04.PositionOther)get_store().insert_element_user(POSOTHER$8, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "POSOTHER" element
     */
    public net.ofx.types.x2003.x04.PositionOther addNewPOSOTHER()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionOther target = null;
            target = (net.ofx.types.x2003.x04.PositionOther)get_store().add_element_user(POSOTHER$8);
            return target;
        }
    }
    
    /**
     * Removes the ith "POSOTHER" element
     */
    public void removePOSOTHER(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(POSOTHER$8, i);
        }
    }
}
